<?php
namespace api;
use api\jeu\perso as nsPerso;
use api\jeu\perso\caracteristique as nsCarac;
use api\jeu\gameplay\actions as nsActions;

error_reporting(E_ALL);

define("GAME", true);

include 'master.php';

$jeu =  jeu\jeu::init();

$jeu->creerPerso(1,1,'Yves - Archange des Sources');


$jeu->perso->addBuff('xp', jeu\perso\buff\BuffManager::getByName('buff1'));
$jeu->perso->addBuff('pa', jeu\perso\buff\BuffManager::getByName('buff2'));
$jeu->perso->addBuff('pv', jeu\perso\buff\BuffManager::getByName('buff3'));
$jeu->perso->addBuff('pi', jeu\perso\buff\BuffManager::getByName('buff3'));
$jeu->perso->addBuff('des', jeu\perso\buff\BuffManager::getByName('buff3'));

//print_r($jeu->perso->buffmanager());

for($i = 0; $i <= 6; $i++)
{
	foreach($jeu->perso->buffmanager() as $buff)
	{
		$stat = ($buff->isDead) ? 0 : 1;
		$carac = "";
		foreach($buff->getCaracteristique() as $s)
		{
			$carac = $s . ", ";
		}
		echo "<br>" . $buff->getValue() . " - " . $buff->getStack() . " (" . $stat . ") - " . $carac;
	}
	
	$jeu->perso->tickBuff();
	//print_r($jeu->perso->buffmanager());
	echo "<hr>";
}
